<!-- 打印当前份 -->
<template>
  <div>
    <button ref="printbtn" class="myprintbtn" v-print="'#myprintDom'"></button>
    <div id="myprintDom" class="nocalssvw">
      <div
        class="print-warp"
        style="page-break-before:always"
        v-for="(image, index) in list"
        :key="index"
      >
        <img :src="image.description" />
      </div>
    </div>
  </div>
</template>
  <script>
export default {
  props: {
    list: {
      type: Array,
      default: () => [],
      required: true,
    },
  },
  data() {
    return {
      myPrint: {
        id: "myprintDom",
        extarCss: "",
      },
    };
  },
  created() {},
  methods: {
    print() {
      this.$refs["printbtn"].click();
    },
  },
};
</script>
  <style>
@page {
  size: auto;
  margin: 0;
}
</style>
  <style scoped lang="scss">
.myprintbtn {
  display: none;
}
#myprintDom {
  position: fixed;
  min-width: 645px;
  left: 900000px;
  right: 900000px;
}
@media print {
  #myprintDom {
    position: static;
    width: 210mm;
    // padding: 10mm;
    img {
      width: 210mm;
      height: 297mm;
    }
  }
}
.print-warp{
  // padding: 15mm;
  img {
      width: 100%;
      height: 100%;
    }
}
</style>